package main

import (
	"fmt"
)

func main() {
	test()
	fmt.Println("hello world")
}

func test() {

	defer func() {
		err := recover()
		if err != nil {
			fmt.Println("错误捕获")
			fmt.Println("err: ", err)
		}
	}()

	num1 := 10
	num2 := 0
	result := num1 / num2

	fmt.Println(result)
}